//
//  MyTableHeaderView.m
//  PlayCatchGame
//
//  Created by 流言 on 2018/1/31.
//  Copyright © 2018年 清正. All rights reserved.
//

#import "MyTableHeaderView.h"

@interface MyTableHeaderView()

@property (nonatomic, copy)ButtonBlock goLoginBlock;
@property (nonatomic, copy)ButtonBlock otherBlock;

@end

@implementation MyTableHeaderView

- (void)setIsLogin:(BOOL)isLogin {
    _isLogin =isLogin;
    if (isLogin) {
        self.loginBgView.hidden =NO;
        self.logoutBgView.hidden =YES;
    } else {
        self.loginBgView.hidden =YES;
        self.logoutBgView.hidden =NO;
        self.leftLabel.text =@"0";
        self.centerLabel.text =@"0.00";
        self.rightLabel.text =@"0.00";
    }
}

- (IBAction)otherButtonClick:(UIButton *)sender {
    if (self.otherBlock) {
        self.otherBlock(sender);
    }
}

- (IBAction)loginButtonClick:(UIButton *)sender {
    if (self.goLoginBlock) {
        self.goLoginBlock(sender);
    }
}

- (void)otherButtonBlock:(ButtonBlock)newBlock {
    self.otherBlock = newBlock;
}

- (void)loginButtonClickBlock:(ButtonBlock)newBlock {
    self.goLoginBlock = newBlock;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
